﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;

namespace S2_Xxxx_XxxNetApi
{
    public static class DictionaryExtension
    {

        public static V Get<K, V>(this Dictionary<K, V> dict,K key)
        {
            if (dict.ContainsKey(key))
                return dict[key];
            else
                return default(V);
        }
        public static string GetDefaultKey(this Dictionary<string, string> dict,string key)
        {
            if (dict.ContainsKey(key))
                return dict[key];
            else
                return key; 
        }

        
    }
}
